Handle case when mkshort has NO valid name.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 18 Jan 2005 19:15:32 +0000 (19:15 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 18 Jan 2005 19:15:32 +0000 (19:15 +0000)
gpsbabel/mkshort.c

index 19ec3a51edb85b7441cc2406996b5a6a74b66c2e..5f40e18033cba6e3e9c88d8a78772c1fc09cbf57 100644 (file)
@@ -386,6 +386,14 @@ mkshort(void *h, const char *istring)
                strcpy(&ostring[hdl->target_len] - strlen(np), np);
        }
 
+       /* 
+        * If, after all that, we have an empty string, punt and
+        * let the must_uniq code handle it.
+        */
+       if (ostring[0] == '\0') {
+               ostring = xstrdup("WPT");
+       }
+
        if (hdl->must_uniq) {
                return mkshort_add_to_list(hdl, ostring);
        }